//
//  SetViewMode.m
//  fitness-iOS
//
//  Created by 卢仕彤 on 2017/12/15.
//  Copyright © 2017年 卢仕彤. All rights reserved.
//

#import "SetViewMode.h"
#import <UIKit/UIKit.h>
#import "UIColor+Expand.h"
#import "FFConfig.h"

@implementation SetViewMode

@end


@interface SetInfoCell ()
@property (nonatomic, strong) UIImageView *rightArrowRightImage;
@end

@implementation SetInfoCell

#pragma -mark ------------------lazy init----------------------

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self configShowCell];
    }
    return self;
}

- (void)configShowCell {
    [self.contentView addSubview:self.titleLab];
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView.mas_left).offset(16);
        make.height.equalTo(@14);
        make.width.equalTo(@150);
    }];
    
    [self.contentView addSubview:self.rightImageView];
    [_rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.size.mas_equalTo(CGSizeMake(22, 22));
    }];
    
    [self.contentView addSubview:self.celarLab];
    [_celarLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView.mas_right).offset(-22);
    }];
    
    [self.contentView addSubview:self.separatorView];
    [_separatorView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        make.height.equalTo(@0.5);
    }];
    
    UIView *lineView = [UIView new];
    [self.contentView addSubview:lineView];
    lineView.backgroundColor = [UIColor colorWithHexString:@"#E7E7E7"];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left);
        make.right.equalTo(self.contentView.right);
        make.bottom.equalTo(self.contentView.bottom);
        make.height.equalTo(@(0.5));
    }];
}

#pragma mark - lazy init
- (UILabel *)titleLab {
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = [UIFont systemFontOfSize:14];
        _titleLab.textColor = [UIColor colorWithHexString:@"#333333"];
    }
    return _titleLab;
}

- (UILabel *)celarLab {
    if (!_celarLab) {
        _celarLab = [[UILabel alloc] init];
        _celarLab.font = [UIFont systemFontOfSize:14];
        _celarLab.textColor = [UIColor colorWithHexString:@"929292"];
        _celarLab.hidden = YES;
    }
    return _celarLab;
}

- (UIView *)separatorView {
    if (!_separatorView) {
        _separatorView = [[UIView alloc] init];
        _separatorView.backgroundColor = FF_Main_Color;
        _separatorView.hidden = YES;
    }
    return _separatorView;
}

- (UIImageView *)rightImageView {
    if (!_rightImageView) {
        _rightImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"right_arrow"]];
        _rightImageView.contentMode = UIViewContentModeCenter;
    }
    return _rightImageView;
}


@end

